package tp4.iterators;


public class ItDecroissant<T> extends ItCroissant<T> {

	public ItDecroissant(T[] tab) {
		super(tab);
		current = tab.length;
	}

	@Override
	public boolean hasNext() {
		return (current > 0);
	}

	@Override
	public T next() {
		return tab[--current];
	}
	
	public T nextAfter() {
		int index =0;
		if (current == 0){
			index = 0;
		} else  {
			index = current -1;
		}
		return tab[index];
	}
	

	public void modifyAfter(T i) {
		tab[current -1] = i;
	}

	
	

	

}
